<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page pageEncoding="utf-8" %>
<%
    String path = request.getContextPath();
    String CONTEXT_PATH = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String DISABLED = "show".equals(request.getParameter("type")) ? "disabled" : "";
    String READONLY = "update".equals(request.getParameter("type")) ? "readonly" : "";
%>
<html>
<head>
    <meta charset="utf-8">
    <title>用户信息</title>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/lib/jquery.min.js"></script>
    <link rel="stylesheet" href="<%=CONTEXT_PATH%>resources/tdh/btn/css/btn.css"/>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/tdh/btn/js/tdh.btn.js"></script>
    <link rel="stylesheet" href="<%=CONTEXT_PATH%>resources/tdh/form/css/form.css"/>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/tdh/form/js/tdh.form.js"></script>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/tdh/form/js/tdh.form.placeholder.js"></script>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/common/common.js"></script>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/plugin/DatePicker/WdatePicker.js"></script>
</head>
<body>
<div class="tdh_form_title">${"add" eq type ? "新增" : "show" eq type ? "查看" : "更新"}用户</div>
<input type="hidden" value="${user.yhxb}" id="hiddenYhxb" />
<input type="hidden" value="${user.yhbm}" id="hiddenYhbm" />
<form>
    <table class="tdh_form">
        <colgroup>
            <col width="10%"/>
            <col width="15%"/>
            <col width="10%"/>
            <col width="15%"/>
        </colgroup>
        <tr>
            <td class="tdTitle"><i class="required">*</i>用户ID</td>
            <td class="tdCont">
                <input class="inputText needCheck" type="text" name="yhid" msg="用户ID" id="yhid"
                        <%=DISABLED%>
                        <%=READONLY%>
                       value="${user.yhid}"
                />
            </td>
            <td class="tdTitle"><i class="required">*</i>姓名</td>
            <td class="tdCont">
                <input class="inputText needCheck"
                       type="text"
                       name="yhxm"
                       msg="用户姓名"
                    <%=DISABLED%>
                       value="${user.yhxm}"
                >
            </td>
        </tr>
        <tr>
            <td class="tdTitle"><i class="required">*</i>用户口令</td>
            <td class="tdCont">
                <input class="inputText needCheck"
                       type="password"
                       id="yhkl"
                       name="yhkl"
                       msg="用户口令"
                    <%=DISABLED%>
                       value="${user.yhkl}"
                ></td>
            <td class="tdTitle"><i class="required">*</i>确认口令</td>
            <td class="tdCont">
                <input class="inputText needCheck"
                       type="password"
                       id="cfkl"
                       name="cfkl"
                       msg="确认口令"
                    <%=DISABLED%>
                       value="${user.yhkl}"
                ></td>
        </tr>
        <tr>
            <td class="tdTitle"><i class="required">*</i>性别</td>
            <td class="tdCont">
                <select class="inputSel needCheck"
                        id="yhxb"
                        name="yhxb"
                        msg="用户性别"
                        value="${user.yhxb}"
                        <%=DISABLED%>
                >
                    <option value=""></option>
                    <c:forEach items="${xbList}" var="gender">
                        <option value="${gender.code}">${gender.mc}</option>
                    </c:forEach>
                </select>

            </td>
            <td class="tdTitle"><i class="required">*</i>部门</td>
            <td class="tdCont">
                <select class="inputSel needCheck"
                        name="yhbm"
                        msg="用户部门"
                        value="${user.yhbm}"
                        id="yhbm"
                        <%=DISABLED%>
                >
                    <option value=""></option>
                    <c:forEach items="${depart}" var="depart">
                        <option value="${depart.bmdm}">${depart.bmmc}</option>
                    </c:forEach>
                </select>
            </td>
        </tr>
        <tr>
            <td class="tdTitle">排序号</td>
            <td class="tCont">
                <input class="inputText"
                       type="text"
                       name="pxh"
                       datatype="onlyInt"
                        <%=DISABLED%>
                       value="${user.pxh}"
                />
            </td>
            <td class="tdTitle">禁用</td>
            <td class="tdCont">
                <input class="inputSwitch"
                       type="checkbox"
                       name="sfjy"
                       data-text="无/启用"
                       ${"1" eq user.sfjy ? "checked='checked'" : ""}
                        <%=DISABLED%>
                />
            </td>
        </tr>
        <tr>
            <td class="tdTitle">出生日期</td>
            <td class="tdCont">
                <input class="Wdate inputText"
                       type="text"
                       onClick="WdatePicker()"
                       name="csrq"
                       readonly="readonly"
                        <%=DISABLED%>
                       value="${user.csrq}"
                />
            </td>
        </tr>
    </table>
</form>
</body>
</html>
